// npm i -S cookie-parser
const express=require('express')
const bodyPaser = require('body-parser')
const cookieParser=require('cookie-parser')
const app=express()
app.listen(8085)
app.use(express.static('../src'))
app.use(bodyPaser.urlencoded({extended:false}))
app.use(cookieParser())
app.get('/a',(req,res)=>{
    // 写入cookie 设置过期时间五分钟
    res.cookie('userbane',['zhangshan','pp'],{maxAge:5*60*1000})
    res.send('ok')
})
app.get('/b',(req,res)=>{
    console.log(req.cookies)
    res.send(req.cookies)
}) 